import Vuex from 'vuex'
import Vue from 'vue'

Vue.use(Vuex)

var defaultUser = {
    id:0,
    name:'',
    description:'',
    role:'',
    token:''
}

const store = new Vuex.Store({
    state:{

        //登录用户
        user:defaultUser
    },

    mutations:{
        user(state,user) {
            state.user = user;
        },
        defaultUser(state){
            state.user = defaultUser;
        }
    }
})

export default store
